package com.zhijiang.hospital.controller;


import com.zhijiang.common.config.result.R;
import com.zhijiang.common.config.webConfig.PassToken;
import com.zhijiang.hospital.entrty.dto.EmployeeDto;
import com.zhijiang.hospital.service.IEmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 75936
 * @version 1.0
 * @project zhiJiangHealthBureau
 * @description
 * @date 2022-12-15 09:43:52
 */
@RestController
@RequestMapping("user")
public class UserController {


//    @PostMapping("/login")
//    public ResponseResult login(@RequestBody User user){
//        return new ResponseResult(200,userService.login(user));
//    }
    @Autowired
    IEmployeeService iEmployeeService;
    @PostMapping("login")
    @PassToken
    public R login(@RequestBody EmployeeDto comEmployee){
        EmployeeDto login = iEmployeeService.login(comEmployee);
        return R.ok(login);
    }

    public R loginOut(@RequestBody EmployeeDto employeeDto){

        return null;
    }

}
